<template>
  <div class="box">
    <header class="header">
      <van-nav-bar title="订单详情" left-arrow @click-left="$router.back()" />
    </header>
    <div class="content">
      <div v-for="item in list" :key="item.id" @click="$router.push(`/myOrder/detail/${item.id}`)">
        <van-swipe-cell>
          <van-card :num="item.count" :price="item.price" :title="item.title" :thumb="item.image" />
        </van-swipe-cell>
        <van-swipe-cell>
          <van-card
            v-for="el in item.orderList"
            :key="el.id"
            :num="el.count"
            :price="el.price"
            :title="el.title"
            :thumb="el.image"
          />
        </van-swipe-cell>
      </div>
    </div>
  </div>
</template>
<script setup>
import request from '@/utils/request.js'
import { onMounted,ref } from 'vue'
const list=ref([])
onMounted(() => {
  request.get('/list',{
    params: {
        pagination:1,
        pageNum:20
    }
  }).then((res) => {
    if(res.data.code==200)
    {
      list.value=res.data.data
    }
  })
})
</script>
